/**************************************************************************//**
 * @file     eev_ctl.h
 * @brief    Electronic expansion valve control Header File
 * @version  V1.00
 * @date     30. November 2017
 *
 * @note
 *
 ******************************************************************************/

#ifndef __EEV_CTRL_H__
#define __EEV_CTRL_H__


/********************************************************************************
 * Include section
 *******************************************************************************/
#include <stdint.h>
#include "BSP_gpio.h"

/********************************************************************************
 * Typedefs, structs and enums
 *******************************************************************************/


/********************************************************************************
 * Constants and macros
 *******************************************************************************/
#define  MAX_STEP 512

#define PHASE0         {MVA_HIGH; MVB_LOW ; MVC_LOW ; MVD_LOW ;}
#define PHASE1         {MVA_HIGH; MVB_HIGH; MVC_LOW ; MVD_LOW ;}
#define PHASE2         {MVA_LOW ; MVB_HIGH; MVC_LOW ; MVD_LOW ;}
#define PHASE3         {MVA_LOW ; MVB_HIGH; MVC_HIGH; MVD_LOW ;}
#define PHASE4         {MVA_LOW ; MVB_LOW ; MVC_HIGH; MVD_LOW ;}
#define PHASE5         {MVA_LOW ; MVB_LOW ; MVC_HIGH; MVD_HIGH;}
#define PHASE6         {MVA_LOW ; MVB_LOW ; MVC_LOW ; MVD_HIGH;}
#define PHASE7         {MVA_HIGH; MVB_LOW ; MVC_LOW ; MVD_HIGH;}

/********************************************************************************
 * Variables
 *******************************************************************************/

 /********************************************************************************
 * prototypes of the functions
 *******************************************************************************/
extern void mg_EEV_Init(uint8_t side);
extern void mg_EEV_SetStepPoint(uint16_t step);
extern uint16_t mg_EEV_GetStepPoint(void);
extern void mg_EEV_StepServo();

/*---------------------------------- End of the file ---------------------------------*/
#endif /* __EEV_CTRL_H__ */

